package top.arryweb.application.controller;


import io.swagger.annotations.Api;
import java.sql.ResultSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import top.arryweb.application.common.constant.Result;
import top.arryweb.application.common.constant.StatusCode;
import top.arryweb.application.domain.dto.CreateDistributionOrderDTO;
import top.arryweb.application.service.IBookKeepDistributionOrderService;

/**
 * <p>
 * 分账订单 前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-05-27
 */
@Api(tags = "分账订单")
@RestController
@RequestMapping("/book-keep-distribution-order")
public class BookKeepDistributionOrderController {

  @Autowired
  private IBookKeepDistributionOrderService distributionOrderService;

  @PostMapping("/getDistributionOrderId")
  public Result<Long> getDistributionOrderId(CreateDistributionOrderDTO dto){
    Long distributionOrderId = distributionOrderService.getDistributionOrderId(dto);
    return new Result<Long>(true, StatusCode.CODE_SUCCESS, "成功获取分账订单ID",distributionOrderId);
  }
}
